package com.test.cmn.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @date 2021/7/29 -11:03
 */
public class ExcelListener extends AnalysisEventListener<UserData> {

    /**
     * 逐行读取数据，第二行开始
     * @param userData
     * @param analysisContext
     */
    @Override
    public void invoke(UserData userData, AnalysisContext analysisContext) {
        System.out.println(userData);
    }
    @Override
    public void invokeHeadMap(Map<Integer,String> headMap,AnalysisContext analysisContext){
        System.out.println("表头信息" +headMap);
    }

    /**
     * 读取后执行
     * @param analysisContext
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
